import request from "@/services/axios";

const UserCommitApi = {
  /**
   * 获取实时终端数据s
   */
  getScreenCurrentDataInfo(data) {
    return request.post({
      url: "/api/irms/modelpush/getScreenCurrentDataInfo",
      data
    });
  },

  /**
   * 获取实时终端数据
   */
  getSystemConfig(params) {
    return request.get({
      url: "/rule/qcsystemconfig/getByKey",
      params
    });
  },

  /**
   * 上传实时终端数据到指定虚拟终端
   * @param data
   * @returns {Promise<*>}
   */
  uploadScreenCurrentDataInfo(data) {
    return request.post({url: "/api/irms/modelpush/uploadScreenCurrentDataInfo", data});
  },

  /**
   * 获取列表
   * @param params
   * @returns {AxiosPromise}
   */
  getSbInfo: async function getSbInfo(params) {
    return await request.get({url: "/terminal/common/getTerminalInfo", params});
  },
  /**
   * 获取虚拟设备
   * @returns {*}
   * @param params
   */
  getVirtualSb(params) {
    return request.get({url: "/terminal/virtualrelation/getVirtualSb", params});
  },

  /**
   *  @desc 获取默认logo
   *  @param { * } params
   * */
  getBaseLogo(params) {
    return request.get({url: "/api/irms/material/getLogo", params});
  },
  /**
   * 模板详情
   * @returns {AxiosPromise}
   * @param data
   */
  async getModelDetail(data) {
    return await request.post({url: "/api/irms/terminal/information/modelDetail", data});
  },
  /**
   * 获取本地模板数据
   * @param data
   * @returns {*}
   */
  getScreenLocalTemplate(data) {
    return request.post({url: "/api/irms/modelpush/getScreenLocalTemplate", data});
  },


  /**
   * @returns {AxiosPromise}
   * @param data
   */
  async getAllJson(data) {
    return await request.post({url: "/api/irms/modelpush/getAllJson"});
  },
  /**
   * 模板详情
   * @param params
   * @returns {AxiosPromise}
   */
  getTemplateDetail(params) {
    return request.get({url: "/api/irms/terminal/information/detail", params});
  },
  /**
   * 更新模板
   * @returns {AxiosPromise}
   * @param data
   */
  updateTemplateDetail(data) {
    return request.post({url: "/api/irms/modelpush/updateJson", data});
  },
  /**
   * 更新在线状态
   * @returns {*}
   * @param data
   */
  updateOnlineStatus(data) {
    return request.post({url: "/terminal/common/updateOnlineStatus", data});
  },
  /**
   * 扫码报到
   * @param data
   * @returns {*}
   */
  initSign(data) {
    return request.post({url: "/api/qcss/sign/initSign", data});
  },
  /**
   * 获取打印小票信息
   * @param data
   * @returns {*}
   */
  signPrint(data) {
    return request.post({url: "/api/qcss/sign/print", data});
  },
  /**
   * 报到
   * @param data
   * @returns {*}
   */
  signAction(data) {
    return request.post({url: "/api/qcss/sign/action", data});
  },
  /**
   * 报到
   * @param data
   * @returns {*}
   */
  signBatchAction(data) {
    return request.post({url: "/api/qcss/sign/batchAction", data});
  },
  /**
   * 获取业务数据
   * @param data
   * @returns {*}
   */
  getAllBizAttr(params) {
    return request.get({url: "/api/irms/commonapi/getAllBizAttr", params});
  },
  /**
   * 获取业务号别
   * @param data
   * @returns {*}
   */
  getBizObjList(params) {
    return request.get({
      url: "/api/irms/commonapi/getBizObjList",
      params
    });
  },
  /**
   * 获取数据源
   * @param data
   * @returns {*}
   */
  getDataSource(url, params = {}) {
    return request.get({
      url: url,
      params
    });
  },

  /**
   * 获取数据源
   * @param data
   * @returns {*}
   */
  getChangeDataSource(apiData = {},params = {}) {
    const {method,reqUrl} = apiData;
    // 扩展参数，增加终端参数
    if (method === 'POST'){
      return request.post({
        url: reqUrl,
        data:params
      });
    }else{
      return request.get({
        url: reqUrl,
        params
      });
    }
  },

  /**
   * 通过终端类型获取排班信息
   * @returns {*}
   * @param params
   */
  getScheduleListByTerminal(params) {
    return request.get({
      url: "/terminal/common/getScheduleListByTerminal",
      params
    });
  },
  /**
   * 午别接口
   * @returns {*}
   * @param params
   */
  getNoonList(params) {
    return request.get({
      url: "/terminal/common/getNoonList",
      params
    });
  },

  /**
   * 特制消息注册
   * @param data
   * @returns {*}
   */
  bindTerminalBusinessFlag(data) {
    return request.post({
      url: "/terminal/common/bindTerminalBusinessFlag",
      data
    });
  },

  /**
   * 排班墙 切屏请求
   * @returns {*}
   * @param params
   */
  schedulingWallNextPage(params) {
    return request.get({
      url: "/irms/schedulingWallDoctor/schedulingWallNextPage",
      params
    });
  },
  /**
   * 获取排班墙数据
   * @returns {*}
   * @param params
   */
  getSchedulingWallNew(params) {
    return request.get({
      url: "/irms/schedulingWallDoctor/getSchedulingWallNew",
      params
    });
  },

};
/**
 * 通大附院
 * @type {{syncSurgeryData: (function(*): *)}}
 */
const TongDaCommitApi = {
  /**
   * 获取即接口数据
   * @returns {*}
   * @param params
   */
  syncSurgeryData(params) {
    return request.get({
      url: "/api/qcss/task/custom/syncSurgeryData",
      params
    });
  },
};
/**
 * 上海第一附院
 * @type {{syncSurgeryData: (function(*): *)}}
 */
const ShangHaiCommitApi = {
  /**
   * 获取即接口数据
   * @returns {*}
   * @param data
   */
  syncSurgeryData(data) {
    return request.post({
      url: "/clinic/api/qcss/led/scheduleList",
      data
    });
  },
};

/**
 * 溧阳
 *
 * custom_liyang_
 * @type {{syncSurgeryData: (function(*): *)}}
 */
const LiYangCommitApi = {
  /**
   * 信息发布屏查询号源
   * @param data
   * @returns {*}
   */
  scheduleShown(data) {
    return request.post({
      url: "/api/information/scheduleShown",
      data
    });
  },
  /**
   * 信息发布屏-检查项目公示
   * @param data
   * @returns {*}
   */
  examItem(data) {
    return request.post({
      url: "/api/information/examItem",
      data
    });
  },
  /**
   * 信息发布屏-专家简介
   * @param data
   * @returns {*}
   */
  expertIntroduce(data) {
    return request.post({
      url: "/api/information/expertIntroduce",
      data
    });
  },

};

const AnDaCommitApi = {
  /**
   * 信息发布屏查询号源
   * @returns {*}
   * @param params
   */
  getBindWorkerByTerminalId(params) {
    return request.get({
      url: "/irms/treatmentRoomDoctor/getBindWorkerByTerminalId",
      params
    });
  },
};

const AnLongXianCommitApi = {
  /**
   * 信息发布屏查询号源
   * @param data
   * @returns {*}
   */
  getWorkerListByTerminal: function (params) {
    return request.get({
      url: '/terminal/common/getWorkerListByTerminal',
      params
    });
  },
}

/**
 * 上海十一
 * @type {{getPrescriptionList: (function(*): *)}}
 */
const ShangHaiShiYiCommitApi = {
  /**
   * 信息发布屏查询号源
   * @param data
   * @returns {*}
   */
  getPrescriptionList: function (data) {
    return request.get({
      url: '/api/qcss/prescription/list',
      data
    });
  },
}

/**
 * 新余市中医院
 * @type {{getGeneralRegisterList: (function(*): *)}}
 */
const XinYuShiCommitApi = {
  /**
   * 先查询该患者当前挂号记录中是否包含通号(可能通过其他方式获取是否包含通号)
   * @param data
   * @returns {*}
   */
  getGeneralRegisterList(data) {
    return request.post({
      url: "/api/qcss/sign/getGeneralRegisterList",
      data
    });
  },
  /**
   * 先查询该患者当前挂号记录中是否包含通号
   * @param data
   * @returns {*}
   */
  getDeptOnlineRegisterObj(data) {
    return request.post({
      url: "/api/qcss/sign/getDeptOnlineRegisterObj",
      data
    });
  },
  /**
   * 患者选中号别后更新挂号记录的通号号别为所选号别
   * @param data
   * @returns {*}
   */
  changeRegisterObj(data) {
    return request.post({
      url: "/api/qcss/sign/changeRegisterObj",
      data
    });
  },


};

/**
 * 桐乡市中医医院
 * @type {{getGeneralRegisterList: (function(*): *)}}
 */
const TongXiangShiCommitApi = {
  /**
   * 先查询该患者当前挂号记录中是否包含通号(可能通过其他方式获取是否包含通号)
   * @param data
   * @returns {*}
   */
  getGeneralRegisterList(data) {
    return request.post({
      url: "/api/qcss/sign/getGeneralRegisterList",
      data
    });
  },

  /**
   * 查询挂号的号别所属科室下所有的医⽣
   * @param data
   * @returns {*}
   */
  getDROnlineRegisterObj(data) {
    return request.post({
      url: "/api/qcss/sign/getRegisterObjDeptOnlineWorker",
      data
    });
  },

  /**
   * 患者选中医生后更新挂号记录的通号号别为所选号别
   * @param data
   * @returns {*}
   */
  changeRegisterObj(data) {
    return request.post({
      url: "/api/qcss/sign/selectWorker",
      data
    });
  },
}


export {UserCommitApi, TongDaCommitApi, ShangHaiCommitApi,LiYangCommitApi, AnDaCommitApi, XinYuShiCommitApi, AnLongXianCommitApi,TongXiangShiCommitApi};
